<?php

/**
 *      [CodeJm!] Author CodeJm[codejm@163.com].
 *
 *      
 *      $Id: Models.php 2016-03-31 15:42:44 codejm $
 */

class ModelsModel extends \Core_CMode {

    public $_table = '`yaf_models`';

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels() {
        return array(
            'm_id' => '车型id', 
            'm_name' => '车型名称', 
            'm_fee' => '费用', 
            'addtime' => '添加时间',
        );
    }

    /**
     * 楠岃瘉瑙勫垯
     *
     */
    public function rules() {
        return array(
            'default'=> array(
                array('m_name', 'required|maxlength[30]'),
                array('m_fee', 'required|maxlength[6]'),
                array('addtime', 'required|maxlength[20]'),

            ),
            'only_add'=> array(
                array('m_name', 'required|maxlength[30]'),
                array('m_fee', 'required|maxlength[6]|numeric|greaterthan[0]'),
                array('addtime', 'required|maxlength[20]'),
            ),
        );
    }

    /**
     * 鎵归噺鍒犻櫎
     *
     */
    public function delModelss($ids) {
        $ids_str = implode(',', $ids);
        $where = 'm_id IN ('.$ids_str.')';
        return $this->delete($where);
    }
}

?>
